package com.ruoyi.system.service.impl;

import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WorkPhotoMapper;
import com.ruoyi.system.domain.WorkPhoto;
import com.ruoyi.system.service.IWorkPhotoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 照片表Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-04-20
 */
@Service
public class WorkPhotoServiceImpl implements IWorkPhotoService 
{
    @Autowired
    private WorkPhotoMapper workPhotoMapper;

    /**
     * 查询照片表
     * 
     * @param id 照片表ID
     * @return 照片表
     */
    @Override
    public WorkPhoto selectWorkPhotoById(Long id)
    {
        return workPhotoMapper.selectWorkPhotoById(id);
    }

    /**
     * 查询照片表列表
     * 
     * @param workPhoto 照片表
     * @return 照片表
     */
    @Override
    public List<WorkPhoto> selectWorkPhotoList(WorkPhoto workPhoto)
    {
        return workPhotoMapper.selectWorkPhotoList(workPhoto);
    }

    /**
     * 新增照片表
     * 
     * @param workPhoto 照片表
     * @return 结果
     */
    @Override
    public int insertWorkPhoto(WorkPhoto workPhoto)
    {
        return workPhotoMapper.insertWorkPhoto(workPhoto);
    }

    /**
     * 修改照片表
     * 
     * @param workPhoto 照片表
     * @return 结果
     */
    @Override
    public int updateWorkPhoto(WorkPhoto workPhoto)
    {
        return workPhotoMapper.updateWorkPhoto(workPhoto);
    }

    /**
     * 删除照片表对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWorkPhotoByIds(String ids)
    {
        return workPhotoMapper.deleteWorkPhotoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除照片表信息
     * 
     * @param id 照片表ID
     * @return 结果
     */
    @Override
    public int deleteWorkPhotoById(Long id)
    {
        return workPhotoMapper.deleteWorkPhotoById(id);
    }

    @Override
    public List<WorkPhoto> selectWorkPhotoByFaultId(Long id) {
        return workPhotoMapper.selectWorkPhotoByFaultId(id);
    }

    @Override
    public void deleteWorkPhotoByFaultId(Long id) {
        workPhotoMapper.deleteWorkPhotoByFaultId(id);
    }

    @Override
    public void deleteWorkPhotoByFaultPhoto(Long id) {
        workPhotoMapper.deleteWorkPhotoByFaultPhoto(id);
    }

    @Override
    public List<WorkPhoto> selectWorkPhotoByByFinishId(Long id) {
        return workPhotoMapper.selectWorkPhotoByByFinishId(id);
    }

    @Override
    public Long insertWorkPhotoByIds(WorkPhoto workPhoto) {
        return workPhotoMapper.insertWorkPhotoByIds(workPhoto);
    }

    @Override
    public int insertWorkPhotoByFault(Long ids1, Long ids2) {
        return workPhotoMapper.insertWorkPhotoByFault(ids1,ids2);
    }

    @Override
    public void insertWorkPhotobyWorkId(Long username, Long id) {
        workPhotoMapper.insertWorkPhotobyWorkId(username,id);
    }

    @Override
    public void deleteWorkPhotoByNothing(Long id1) {
        workPhotoMapper.deleteWorkPhotoByNothing(id1);
    }
}
